<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--<%@ page errorPage="failure.jsp" isErrorPage="true" %>--%>
<html>
<head>
    <title>Title</title>
</head>
<body>

<%
  boolean oddFlag = true;
  StringBuilder oddBuilder = new StringBuilder();
  StringBuilder evenBuilder = new StringBuilder();
  for (int index = 1; index<=100; index++) {
    if (oddFlag) {
      oddBuilder.append(index).append(",");
    }else {
      evenBuilder.append(index).append(",");
    }

    oddFlag = !oddFlag;
  }

//  int result = 5/0;

  out.println("奇数：" + oddBuilder.subSequence(0, oddBuilder.length()-1));

  out.println("偶数" + evenBuilder.subSequence(0, evenBuilder.length()-1));
%>

</body>
</html>
